﻿using Autodesk.Revit.DB;
using demo.Extensions;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XS.Tunnel.Infrastructure.Extensions;

namespace demo
{
    public class 抛物线
    {
        public static void Test_Arc(Document document)
        {
            List<XYZ> points = new List<XYZ>();
            for (double x = 0; x <= 3; x += 0.1)
            {
                Debug.Write($"{x},{Math.Pow(0.5 * x, 3)}    ");
                XYZ point = new XYZ(x, Math.Pow(0.5 * x, 3), 0);
                points.Add(point);
            }

            Curve curve = HermiteSpline.Create(points, false);
            using (Transaction transaction = new Transaction(document, "tCreateAndStore"))
            {
                transaction.Start();
                TransformUtils.CreateModelCurve(document, curve);

                transaction.Commit();
            }
        }

    }
}
